package 进阶.递归;

import java.util.Scanner;

public class demo01 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int i = s.nextInt();
        int x = m(i);
        System.out.println(x);

    }

    /*public static int m(int i) {
        if(i == 0){
            return 0;
        }
        return i + m(i - 1) ;
    }*/
    public static int m(int i){
        //这里返回0的话算出的值永远为0
        if (i == 1){
            return 1;
        }
        return i * m(i -1);
    }
}
